-
Notifications
You must be signed in to change notification settings - Fork 7
Feat: Page Indicator (v1) #667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: Page Indicator (v1) #667
Conversation
70452a1
to
23ff1d6
Compare
Updates code to use `PrimaryKey` instead of `Key` property in `SiteMapping` for identifying pages. This change improves clarity and consistency by using a more descriptive name for the primary key field.
2d95ac3
to
47fe4d1
Compare
Modifies the FindPercentComplete method to return null when the key is null. Updates the unit test to reflect the change in behavior. Updates styling for elements related to current page display.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a visual progress indicator to content pages by calculating and displaying the percentage of pages viewed, with supporting style and test updates.
- Introduces a new
FindPercentComplete
extension and exposespercentComplete
in the layout and JS app. - Adds CSS rules for
.page-menu
and.menu-progress
to style the progress indicator. - Updates tests to cover basic
FindPercentComplete
scenarios.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
wwwroot/js/site.js | Added percentComplete ref, isContentPage computed, and exposed progress state |
wwwroot/css/styles.css | Added .page-menu and .menu-progress styles for the progress display |
Views/Shared/_Layout.cshtml | Passes percentComplete from server, updates layout to show percentage |
Services/SiteMappingListExtensions.cs | Implements FindPercentComplete extension with XML docs |
Controllers/HomeController.cs | Sets ViewBag.CurrentPageKey used by FindPercentComplete |
Services/SiteMappingService.cs | Cleaned up stray whitespace |
Services/ISiteMappingService.cs | Normalized namespace declaration |
Tests/SiteMappingTests.cs | Added tests for null, whitespace, valid, and empty-list scenarios |
Comments suppressed due to low confidence (2)
EssentialCSharp.Web.Tests/SiteMappingTests.cs:138
- There’s no test for the scenario where the key isn’t present in the mappings list. Add a test to verify the behavior (e.g., returns null or "0.00").
Assert.Equal("0.00", percent);
EssentialCSharp.Web/Extensions/SiteMappingListExtensions.cs:33
- The XML comment indicates a formatted double but the method returns a string; update the
<returns>
to reflect that a formatted string is returned.
/// <returns>Returns a formatted double for use as the percent complete.</returns>
Ensures that the FindPercentComplete method returns "0.00" when a key is not found in the sitemap, preventing potential incorrect calculations or errors.
Description
Added progress percent to top of page. I want to iterate on this feature with some of the following possible changes:
Fixes IntelliTect-dev/EssentialCSharp.Tooling#442
Ensure that your pull request has followed all the steps below: